package x.zero.mapper;
import org.beetl.sql.mapper.BaseMapper;
import org.beetl.sql.mapper.annotation.Sql;
import x.zero.pojo.entity.*;
import x.zero.pojo.vo.AreaWithChildrenItem;

import java.util.List;

/*
*
* gen by beetlsql3 mapper 2021-01-15
*/
public interface SysAreaMapper extends BaseMapper<SysArea> {
    @Sql(value = "select\n" +
            "        c1.id,\n" +
            "        c1.name,\n" +
            "        c2.id child_id,\n" +
            "        c2.name child_name\n" +
            "        from sys_area c1 left join sys_area c2 on c1.id = c2.pid\n" +
            "        where c1.deep = 0")
    List<AreaWithChildrenItem> listWithChildren();
}
